package main
import (
	"fmt"
)

type Writer interface{
	WriteBook()
}

type Reader interface{
	ReadBook()
}

type Book struct{

}

func (this *Book) ReadBook(){
	fmt.Println("read book...")
}

func (this *Book) WriteBook(){
	fmt.Println("write book...")
}

func main(){

	b := &Book{}

	var r Reader
	r = b

	r.ReadBook()

	// w := b
	// w.WriteBook()
	w := r.(Writer)
	w.WriteBook()
}